<!--
*  功能描述：绩效管理：部门奖金分配
 -->
<template>
  <div>
    <div>
      <el-descriptions title="部门奖金计算" :column="2" border>
      </el-descriptions>
      <el-form :inline="true" class="demo-form-inline">
        <el-form-item label="考核任务">
          <el-select v-model="AssId" placeholder="请选择">
            <el-option v-for="item in DeptData" :key="item.AssId" :label="item.AssId" :value="item.AssId">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="show">查询</el-button>
          <el-button type="danger" @click="loadExcel">导出数据</el-button>
        </el-form-item>
      </el-form>
    </div>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="DepName" label="部门名称">
      </el-table-column>
      <el-table-column prop="CulaAge" label="平均工资">
      </el-table-column>
      <el-table-column prop="CulaAchie" label="部门绩效">
      </el-table-column>
      <el-table-column prop="CulaProportion" label="部门奖金占比">
      </el-table-column>
      <el-table-column prop="CulaSum" label="部门总奖金">
      </el-table-column>
      <el-table-column prop="Culamultiple" label="月工资倍数">
      </el-table-column>
      <el-table-column prop="CulaProjectbonus" label="项目奖金">
      </el-table-column>
      <el-table-column prop="CulaProporbonus" label="项目奖金占比">
      </el-table-column>
      <el-table-column prop="CulaDepBouns" label="部门内奖金">
      </el-table-column>
      <el-table-column prop="CulaYearTop" label="2021上半年">
      </el-table-column>
      <el-table-column prop="CulaYearlower" label="2020下半年">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data () {
    return {
      tableData: [],
      DeptData: [],
      AssId: '',
    }
  },
  methods: {
    show () {
      this.$http({
        url: 'AssBonu/GetBounDepListView',
        mounted: 'get',
        params: {
          AssId: this.AssId,
        }
      })
        .then(res => {
          this.tableData = res.data
        })
    },
    showMent () {//任务下拉
      this.$http({
        url: 'AssProjectA/GetAssessmentList',
        method: 'get',
      })
        .then(res => {
          this.DeptData = res.data
        })
    },
    //导出excel
    loadExcel () {
      if (confirm("是否确定下载")) {
        window.open("AssBonu/Downloadexcel")
      }
    },
  },
  mounted () {
    this.show();
    this.showMent();
  }
}
</script>